package org.example.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 贷款数据Excel导入DTO
 * 用于EasyExcel导入时的数据映射
 * 包含用户基本信息和还款计划信息
 */
@Data
public class LoanDataExcelDTO {

    /**
     * 下单订单号
     */
    @ExcelProperty(value = "下单订单号", index = 0)
    private String orderNumber;

    /**
     * 用户ID
     */
    @ExcelProperty(value = "user_id", index = 1)
    private Long userId;

    /**
     * 放款时间
     */
    @ExcelProperty(value = "放款时间", index = 2)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private LocalDateTime loanTime;

    /**
     * 放款金额
     */
    @ExcelProperty(value = "放款金额", index = 3)
    @NumberFormat("#.##")
    private BigDecimal loanAmount;

    /**
     * 期数
     */
    @ExcelProperty(value = "期数", index = 4)
    private Integer installmentCount;

    /**
     * 到期时间
     */
    @ExcelProperty(value = "到期时间", index = 5)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private LocalDateTime dueTime;

    /**
     * 实还时间
     */
    @ExcelProperty(value = "实还时间", index = 6)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private LocalDateTime actualRepayTime;

    /**
     * 还款状态(1在途2正常还款3逾期还款)
     */
    @ExcelProperty(value = "还款状态", index = 7)
    private Integer repayStatus;

    /**
     * 逾期天数
     */
    @ExcelProperty(value = "逾期天数", index = 8)
    private Integer overdueDays;

    /**
     * 应收本金
     */
    @ExcelProperty(value = "应收本金", index = 9)
    @NumberFormat("#.##")
    private BigDecimal principalReceivable;

    /**
     * 收货地址省
     */
    @ExcelProperty(value = "收货地址省", index = 10)
    private String shippingProvince;

    /**
     * 收货地址市
     */
    @ExcelProperty(value = "收货地址市", index = 11)
    private String shippingCity;

    /**
     * 收货地址区
     */
    @ExcelProperty(value = "收货地址区", index = 12)
    private String shippingDistrict;

    /**
     * 性别(0女1男)
     */
    @ExcelProperty(value = "性别", index = 13)
    private Integer gender;

    /**
     * 生日
     */
    @ExcelProperty(value = "生日", index = 14)
    @DateTimeFormat("yyyy-MM-dd")
    private LocalDate birthday;

    /**
     * 月收入
     */
    @ExcelProperty(value = "月收入", index = 15)
    @NumberFormat("#.##")
    private BigDecimal monthlyIncome;

    /**
     * 学历
     */
    @ExcelProperty(value = "学历", index = 16)
    private String education;

    /**
     * 婚姻状况
     */
    @ExcelProperty(value = "婚姻状况", index = 17)
    private String maritalStatus;

    /**
     * 芝麻信用分
     */
    @ExcelProperty(value = "sesame_score", index = 18)
    private Integer sesameScore;
}
